package com.jf.yytgd.entity.dto.user;

import com.jf.yytgd.validation.constrain.Phone;
import com.jf.yytgd.validation.constrain.VisibleASCII;
import com.jf.yytgd.validation.constrain.VisibleCharacter;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA
 * Description: 用户注册DTO
 * User:22954
 * Date:2025-02-05
 * Time:21:34
 */
@Data
public class UserRegisterDTO {
    @Setter(AccessLevel.NONE)
    private Integer id;
    @NotEmpty(message = "昵称不得为空")
    @VisibleCharacter
    private String nickname;
    @NotEmpty(message = "用户名不得为空")
    @VisibleCharacter
    private String username;
    @NotEmpty(message = "密码不得为空")
    @VisibleASCII(message = "密码校验失败")
    @Size(min = 6, message = "密码校验失败")
    private String password;
    @Phone(message = "电话格式校验失败")
    private BigDecimal phone;
    @Email(message = "邮箱格式校验失败")
    private String email;
    private String portraitPath;
    private MultipartFile portrait;
    private String verificationCode;
    public static final String DEFAULT_PORTRAIT_PATH = "aaa.jpg";
}
